<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0px;
            margin: 0px;
        }

        html,body{
            height: 100%;
        }

        body{
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .container{
            width: 500px;
            height: 500px;
            border: 1px solid black;
            overflow: auto;
        }

        .content{
            background-color: lightgreen;
            height: 1000px;
        }

        header{
            height: 40px;
            background-color: lightgray;
            text-align: center;
            line-height: 40px;
            position: sticky;
            top: 0px
        }

        .box{
            width: 100px;
            height: 100px;
            background-color: lightcoral;
            position: relative;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="content">
            <header>HEADER</header>
            <div class="box"></div>
        </div>
    </div>
</body>
</html>